<template>
	<view class="receipt-info">
		<view class="info-content">
			<view class="b-info">
				<!-- 客户 -->
				<customTitle :title="pageTitle" :customer_info="customerInfo" :showArrow="showSettlement"
					:switchTxt="switchTxt" :seeCustom="seeCustom" :isShowName="isShowName" :isShowCp="isShowCp"
					:orderType="orderType" @back="backCart" @addCustom="addCustom" @showCustmInfo="showCustmInfo"
					@swichTypeHandler="swichTypeHandler">
				</customTitle>

				<!-- 开单 -->
				<view class="overflow-box" :style="{ height: `calc(100vh - ${boxHeight}px)` }"
					v-show="cartList.length > 0 && showSettlement == -1">
					<cart ref="cart" :list="cartList" :limitChangePrice="limitChangePrice" @editCartInfo="editCartInfo"
						@saveCart="saveCart">
					</cart>
				</view>

				<!-- 结算-->
				<view class="overflow-box" :style="{ height: `calc(100vh - ${boxHeight}px)` }"
					v-show="showSettlement != -1">
					<settlement ref="settlement" :isHasYunPrint="isHasYunPrint" :orderType="orderType"
						:customerInfo="customerInfo" :setSellData="setSellData"
						:limitBillChangeManger="limitBillChangeManger" :limitBillChangeTime="limitBillChangeTime"
						@finishOrderBack="finishOrderBack">
					</settlement>
				</view>

				<!-- 编辑工具按钮 -->
				<reciptBtomTBar v-if="cartList.length > 0" class="bttom-btn-box" :number="tabTotal.number"
					:showSettlement="showSettlement" :totalPrice="tabTotal.totalPrice"
					:amountOrderPrice="tabTotal.amountOrderPrice" :discount="tabTotal.discount"
					:preferential="tabTotal.preferential" :netReceiVal="tabTotal.netReceiVal"
					:payTypeTxt="tabTotal.payTypeTxt" :limitChangePrice="limitChangePrice"
					:limitBillChangeTime="limitBillChangeTime" @optionAct="optionAct">
				</reciptBtomTBar>

				<empty :style="'height:' + emptyHight + 'px'" @emptyAct="emptyAct" :isReceipt="true"
					v-if="cartList.length == 0 && showSettlement == -1"></empty>
			</view>

			<!-- 客户 -->
			<view class="c-info" v-show="type == 1 && showInfo">
				<receiptCustomerInfo ref="receCustInfo" :customerInfo="customerInfo" :isShowName="isShowName"
					:isShowCp="isShowCp" @closeCustmInfo="closeCustmInfo" @changeSendGoodsType="changeSendGoodsType"
					@consignVal="consignVal" @inputPhone="inputPhone" @areaChange="areaChange"
					@inputAddress="inputAddress">
				</receiptCustomerInfo>
			</view>

			<!-- 加购产品 -->
			<view class="c-info" v-show="type == 2 && showInfo">
				<addReceiptCart ref="addReceiptCart" :setSellData="setSellData" :limitChangePrice="limitChangePrice"
					@saveCart="saveCart" @closeAddRecep="closeAddRecep">
				</addReceiptCart>
			</view>
		</view>
		<orderDiscountWin ref="orderDiscountWin"></orderDiscountWin>
		<payQrcode ref="payQrcode"></payQrcode>
	</view>
</template>

<script>
import eventCtrl from "../../js/event/EventCtrl.js";

import customTitle from '../comm/CustomTitle.vue';

import reciptBtomTBar from "./ReceiptBottomTabbar.vue";

import empty from '../comm/empty.vue';

import config from "../../js/conf/Config.js";

import accessCtrl from "../../js/limit/AccessCtrl.js";

import https from "../../js/https/Https.js";

import cmd from "../../js/Cmd.js";

import util from "../../js/util/Util.js";

import cart from "./Cart.vue";

import cartCtrl from "../../js/rereipt/CartCtrl.js";

import addReceiptCart from "./AddReceiptCart.vue";

import staticConst from "../../js/const/StaticConst.js";

import orderDiscountWin from "../comm/OrderDiscountWin.vue";

import lang from "../../js/conf/Lang.js";

import settlement from "./Settlement.vue";

import receiptCustomerInfo from "./ReceiptCustomerInfo.vue";

import payQrcode from "../comm/PayQrcode.vue";

import localStore from "../../js/LocalStore.js";

import printCtrl from "../../js/print/PrintCtrl.js";

import customCtrl from "../../js/custom/CustomCtrl.js";

let time = 200;//延时器触发时间
let printSize = 0;
export default {
	components: {
		empty,
		customTitle,
		reciptBtomTBar,
		cart,
		addReceiptCart,
		orderDiscountWin,
		settlement,
		receiptCustomerInfo,
		payQrcode
	},
	data() {
		return {

			seeCustom: false,

			orderType: 1,//订单类型: 1:销售单，2退货单
			pageTitle: "",
			saleTitle: lang.receiptCheckOut.title,
			newXsTitTxt: lang.receiptCheckOut.newXsTitTxt,
			newReturnTitTxt: lang.receiptCheckOut.newReturnTitTxt,
			returnTitTxt: lang.receiptCheckOut.returnTitTxt,

			switchTipTitTxt: lang.receiptCheckOut.switchTipTitTxt,
			switchReTipMsgTxt: lang.receiptCheckOut.switchReTipMsgTxt,
			switchSaleTipMsgTxt: lang.receiptCheckOut.switchSaleTipMsgTxt,

			switchNullTipTxt: lang.receiptCheckOut.switchNullTipTxt,

			tipSelectGdTxt: lang.receiptCheckOut.tipSelectGdTxt,

			switchTxt: "",
			returnTxt: lang.receiptCheckOut.returnTxt,
			saleTxt: lang.receiptCheckOut.saleTxt,

			customerInfo: {},
			boxHeight: 211,
			type: 0,//0，隐藏，1客户，2：产品
			oldType: 0,//保存上次记录

			showInfo: false,

			setSellData: {},

			cartList: [], //购物列表

			//底部数量统计
			tabTotal: {
				number: 0, //数量
				totalPrice: 0,//总价
				amountTotle: "",//原价
				discount: 0,//折扣 
				preferential: 0,//优惠
				amountZero: -1,//抹零后价格
				netReceiVal: 0,//实际收取金额
				payTypeTxt: "",
				amountOrderPrice: 0,//订单总价（折后/优惠）
				amountFee: 0,//费用
				amountOrPri: 0,//保存原始价格
			},

			orderAct: -1, //记录单据操作，存草稿用

			showSettlement: -1, //-1默认不显示，

			ucpList: [], //经手人列表，

			emptyHight: uni.getSystemInfoSync().windowHeight - 110,

			limitChangePrice: true,//开单是否可以修改价格

			limitBillChangeManger: true, //开单经手人是否可改

			limitBillChangeTime: true, //开单是否可以改时间

			cpid: "",//企业id
			isShowCp: true,//是否显示客户公司名称
			isShowName: true,//是否显示客户名称
			isHasYunPrint: true,//是否有云打印
		};
	},
	methods: {
		/***选中开单产品****/
		addGoodsReceipt(data) {
			this.isShowCp = customCtrl.getIsShowCp();
			this.isShowName = customCtrl.getIsShowName();
			this.emptyHight = uni.getSystemInfoSync().windowHeight - 110;
			this.showInfo = true;
			this.showHideRigthWin();
			this.$refs.cart.reset();
			this.type = 2;
			this.oldType = 0;
			this.$refs.addReceiptCart.initGdInfo(data);
		},

		/****扫码枪加购产品****/
		scanGunSelectGds(gdInfo) {
			let price_quote_type = gdInfo.price_quote_type;
			if (price_quote_type == 0 || gdInfo.specUnit == "") {
				let step = Number(util.getInt(this.setSellData.num_step));
				this.$refs.cart.scanGunSaveCart(gdInfo, step);
			}
			else {
				this.addGoodsReceipt(gdInfo);
			}
		},

		/***获取客户信息*****/
		getCustomInfo(data, isCheckOut) {
			this.isShowCp = customCtrl.getIsShowCp();
			this.isShowName = customCtrl.getIsShowName();
			let that = this;
			if (!this.customerInfo || !this.customerInfo.id) //没有选择客户
			{
				this.customerInfo = data;
				if (!isCheckOut)//不是结账页面
				{   //不是结算,
					this.$refs.addReceiptCart.setCustom(this.customerInfo.id);
				}
				// else
				// {
				//结帐页面
				this.$refs.cart.changCustomer(this.customerInfo.id);
				// }
				return;
			}

			if (this.customerInfo.id != data.id) {
				if (this.cartList && that.cartList.length > 0) {
					let obj = {};
					obj.content = "你当前开单是客户:" + this.customerInfo.name + ",是否要跟换成客户:" + data.name;
					obj.showCancel = true;
					lang.showWin(obj, back);
				}
				else {
					this.customerInfo = data;
					this.$refs.addReceiptCart.setCustom(this.customerInfo.id);
				}
			}
			else {
				this.customerInfo = data;
				this.$refs.cart.changCustomer(this.customerInfo.id);
			}

			function back(res) {
				if (res && res.confirm) {
					that.customerInfo = data;
					that.$refs.cart.changCustomer(that.customerInfo.id);
				}
			}
		},

		/****展示用户更多信息****/
		showCustmInfo() {
			if (this.showInfo) {
				if (this.type == 2) {
					this.oldType = this.type;
					this.type = 1;
				}
				else {
					if (this.oldType == 2) {
						this.type = this.oldType;
					}
					else {
						this.type = 0;
						this.showInfo = false;
						this.showHideRigthWin();
					}
				}
			}
			else {
				this.type = 1;
				this.showInfo = true;
				this.showHideRigthWin();
			}
		},

		/****获取是否有云打印列表******/
		getYunPrintList() {
			let that = this;
			let param = {};
			https.getPrintYunList(param, back)
			function back(data) {
				if (!data) return;
				if (data.status == 1) {
					if (!data.data) return;
					data = data;
					if (data.ls && data.ls.length > 0) {
						that.isHasYunPrint = true;
					}
				}
			}
		},

		/****关闭用户信息***/
		closeCustmInfo() {
			if (this.oldType == 2) {
				this.type = this.oldType;
			}
			else {
				this.showInfo = false;
				this.type = 0;
				this.showHideRigthWin();
			}
		},

		/***返回购物车****/
		backCart() {
			this.showSettlement = -1;
			// this.boxHeight = 170;
			this.$emit("checkOut", false);
			this.setDjTitle();
		},


		/***点击添加客户****/
		addCustom() {
			this.$emit("addCustom");
		},

		/****选择开单产品*****/
		emptyAct(act) {
			if (act == 1) {
				this.$emit("selectReceiptGoods");
			}
		},

		async initData() {
			this.seeCustom = await accessCtrl.getLimitSeeCustomer();
			this.boxHeight = this.seeCustom ? 211 : 108;
			let cp = await localStore.getCpInfo();
			this.cpid = cp.id;
			this.getPrintSize(this.cpid);
			this.limitChangePrice = await accessCtrl.getLimitChangePrice();//开单是否可以修改价格
			this.limitBillChangeManger = await accessCtrl.getLimitBillChangeManger(); //开单经手人是否可改
			this.limitBillChangeTime = await accessCtrl.getLimitBillChangeTime(); //开单是否可以改时间
			this.clearData();
			await this.getSettingSell();
			await this.getCartInfo();
			await this.loadUcpList();
			await this.getYunPrintList();

			//判断是否有开单客户
			let tempCInfo = customCtrl.getBillCustom();
			if (tempCInfo) {
				let data = JSON.parse(JSON.stringify(tempCInfo));
				this.getCustomInfo(data);
				tempCInfo = null;
				customCtrl.setBillCustom(null);
			}
		},

		/*****经手人列表*****/
		async loadUcpList() {
			let that = this;
			this.ucpList = [];
			https.loadUcpList(back);
			function back(data) {
				if (!data) return;
				let len = data.length;
				for (let i = 0; i < len; i++) {
					let obj = data[i];
					let temp = {};
					temp.id = obj.uid;
					temp.title = obj.name;
					that.ucpList.push(temp);
				}
			}
		},

		/***销售配置***/
		getSettingSell() {
			let that = this;
			let param = {};
			https.getSettingSell(param, back);
			function back(data) {
				if (!data) return;
				if (data.status == 1) {
					if (!data.data) return;
					data = data.data;
					that.setSellData.is2amount = data.is2amount;//"默认收款为应收，1是2否	
					that.setSellData.is_fee = data.is_fee;//开单是否打开费用，1是2否
					that.setSellData.is_seller = data.is_seller; //显示经手人，1是2否
					that.setSellData.is_txt = data.is_txt;//显示单据备注，1是2否
					that.setSellData.is_zk_sku = data.is_zk_sku;//开单是否显示折扣-sku，1是2否
					that.setSellData.isscan_act = data.isscan_act;//扫码时动作，开单时扫码时动作，1直接开单；2去加购
					that.setSellData.isscan_num_step = data.isscan_num_step;//扫码加购时按下单数量加减步长，1是2否
					that.setSellData.money_p = data.money_p;//价格小数位
					that.setSellData.num_min = util.getInt(data.num_min);//产品起订量，对于每个sku
					that.setSellData.num_p = Number(data.num_p);//数量小数位
					that.setSellData.num_step = util.getInt(data.num_step);//下单数量加减步长，不支持多规格多条码
				}
			}
		},

		/***底部按钮操作***/
		optionAct(act) {
			if (act == staticConst.RECEIPT_DEL_ACT) //清除购物车
			{
				this.removeCartInfo();
			}
			else if (act == staticConst.RECEIPT_DISC_ACT
				|| act == staticConst.RECEIPT_ZERO_ACT)//折扣，抹零
			{
				if (!this.limitChangePrice) {
					this.$msg({ title: lang.receiptCheckOut.noChangePriceTip })
					return;
				}

				this.orderAct = act;
				this.$refs.orderDiscountWin.show("show", act, this.tabTotal);
			}
			else if (act == staticConst.RECEIPT_DERIFT_ACT) //草稿
			{
				this.isSureSaveDerift();
			}
			else if (act == staticConst.RECEIPT_SETTLEMENT_ACT)//结算
			{
				if (this.showSettlement == -1)
					this.orderCheckOut();
				else
					this.$refs.settlement.finishOrder();
			}
		},

		/*****清理数据*****/
		clearData() {
			this.customerInfo = null;
			this.cartList = [];
			this.tabTotal = {
				number: 0, //数量
				totalPrice: 0,//总价
				amountTotle: "",//原价
				discount: 0,//折扣 
				preferential: 0,//优惠
				amountZero: -1,//抹零后价格
				netReceiVal: 0,//实际收取金额
				payTypeTxt: "",
				amountOrderPrice: 0,//订单总价（折后/优惠 + 费用）
				amountOrPri: 0,//保存原始价格
			};
			this.$refs.addReceiptCart.setCustomerIdNull();
			// this.$refs.receCustInfo.clearData();
		},

		//放弃开单
		removeCartInfo() {
			let that = this;
			let data = {};
			data.title = lang.receiptAct.removeOrderTit;
			data.content = lang.receiptAct.removeOrderTxt;
			data.showCancel = true;
			lang.showWin(data, callBack);
			function callBack(res) {
				if (res.confirm) {
					that.$refs.settlement.retData();
					that.showSettlement = -1;
					that.$emit("setGdCustomIdNull");
					// that.boxHeight = 170;
					that.$emit("checkOut", false);
					that.clearData();
					that.$refs.cart.saveCart(null, 1);
					that.setDjTitle();
				}
			}
		},

		/****提示是否存草稿单***/
		isSureSaveDerift() {
			let that = this;
			let data = {};
			data.title = lang.receiptAct.deriftOrdTit;
			data.content = lang.receiptAct.deriftOrdTxt;
			data.showCancel = true;
			lang.showWin(data, callBack);
			function callBack(res) {
				if (res.confirm) {
					if (that.showSettlement == -1)
						that.saveDerift();
					else
						that.saveCheckOutDerift();
					that.setDjTitle();
				}
			}
		},

		/****存草稿单***/
		saveDerift() {
			let that = this;
			let param = {};
			param.backup = 1;
			param.amount = this.tabTotal.totalPrice;
			if (this.orderAct == staticConst.RECEIPT_ZERO_ACT)//抹零操作 
			{
				param.discount_r = -1;
				param.amount_zero = this.tabTotal.amountZero;
			}
			else //折扣，没有折扣，抹零操作
			{
				param.discount_r = this.tabTotal.discount;
				param.amount_zero = -1;
			}
			param.amount_od = this.tabTotal.amountOrderPrice;
			https.orderAdd(param, back);
			function back(data) {
				if (!data) return;
				if (data.status == 1) {
					that.clearData()
					that.$msg({ title: data.msg, callback: callBack });
				}
			}

			function callBack() {
				that.saveCart();
			}
		},

		/***结帐页面存草稿***/
		saveCheckOutDerift() {
			this.$refs.settlement.finishOrder(1); //存草稿
		},

		/***加购成功***/
		saveCart() {
			if (this.showSettlement == -1) {
				//购物车页面
				this.closeAddRecep();
				this.getCartInfo();
			}
			else {
				//结账页面，
				this.orderCheckOut();
			}
			this.setDjTitle();
		},

		/****检查是否有下架产品*****/
		checkNotSale() {
			let len = this.cartList.length;
			for (let i = 0; i < len; i++) {
				let obj = this.cartList[i];
				if (obj.onsale != 1) return false;
			}
			return true;
		},

		/***购物信息****/
		getCartInfo() {
			let that = this;
			this.orderType = 1;
			let param = {};
			this.cartList = [];
			https.getCartInfo(param, back);
			function back(data) {
				if (!data) return;
				if (data.status == 1) {
					if (!data.data) return;
					data = data.data;
					if (data.customer)
						that.customerInfo = data.customer;
					if (data.hasOwnProperty('type')) {
						if (data.type == 0) {
							that.orderType = 1; //默认开销售单
						}
						else {
							that.orderType = data.type;
						}
					}
					if (data.gd_ls) {
						that.cartList = cartCtrl.cartInfoHandler(data.gd_ls, that.setSellData);
					}
					if (data.num_totle)
						that.tabTotal.number = util.getInt(data.num_totle);
					if (data.amount)
						that.tabTotal.totalPrice = data.amount;

					if (data.amount_od) {
						that.tabTotal.amountOrderPrice = data.amount_od;
						that.tabTotal.amountOrPri = data.amount_od;
					}

					if (data.amount_p)
						that.tabTotal.amountTotle = data.amount_p;
					if (data.discount_r)
						that.tabTotal.discount = util.getInt(data.discount_r);
					if (data.discount)
						that.tabTotal.preferential = util.getInt(data.discount);
					that.orderAct = data.countype;
					that.setDjTitle();
				}
			}
		},

		setDjTitle() {
			if (this.orderType == 1) {
				if (this.showSettlement == -1) {
					this.pageTitle = this.newXsTitTxt;
					this.switchTxt = this.returnTxt;
				}
				else
					this.pageTitle = this.saleTitle;
			}
			else {
				if (this.showSettlement == -1) {
					this.pageTitle = this.newReturnTitTxt;
					this.switchTxt = this.saleTxt;
				}
				else
					this.pageTitle = this.returnTitTxt;
			}
		},

		/***切换开单类型*****/
		swichTypeHandler() {
			if ((!this.customerInfo || !this.customerInfo.id) && this.cartList && this.cartList.length == 0) {
				let msg = this.switchNullTipTxt;
				if (!this.seeCustom)
					msg = this.tipSelectGdTxt;
				this.$msg({ title: msg });
				return;
			}
			let that = this;
			let msg = this.orderType == 1 ? this.switchReTipMsgTxt : this.switchSaleTipMsgTxt;
			let data = {};
			data.title = this.switchTipTitTxt;
			data.content = msg;
			data.showCancel = true;
			lang.showWin(data, back);
			function back(res) {
				if (res.confirm) {
					let type = that.orderType == 1 ? 2 : 1;
					that.$refs.cart.saveCart(null, null, type);
				}
			}
		},

		/****编辑产品****/
		editCartInfo(item) {
			this.$emit("editCart");
			if (!item || !item.gdid) return;
			let that = this;
			let url = config.GD_INFO;
			let param = {};
			param.goods_id = item.gdid;

			https.loadGoodsInfo(param, back);
			function back(data) {
				if (!data) return;
				that.showInfo = true;
				that.showHideRigthWin();
				let obj = {};
				if (data.goodsInfo.imgs && data.goodsInfo.imgs_s)
					data.goodsInfo.imgs = data.goodsInfo.imgs_s[0];
				obj.gdInfo = data.goodsInfo;
				obj.cartInfo = item;
				that.$refs.addReceiptCart.editCart(obj);
				that.type = 2;
				that.oldType = 0;
			}
		},

		/****关闭加购***/
		closeAddRecep() {
			this.showInfo = false;
			this.showHideRigthWin();
			this.type = 0;
			this.$emit("editCart"); //取消产品列表选中状态
			this.$refs.cart.reset();//
		},

		/***开单-去结账***/
		orderCheckOut() {
			let that = this;
			if (this.checkNotSale()) {
				orderCheckout();
			}
			else {
				if (this.checkNotSale()) {
					orderCheckout();
				}
				else {
					//提示有下架产品，
					let data = {};
					data.content = lang.notSaleGdCheckOutTip;
					data.showCancel = true;
					data.confirm = lang.jsTxt;
					lang.showWin(data, back);
				}
			}

			function back(res) {
				if (res.confirm) {
					orderCheckout();
				}
			}

			function orderCheckout() {
				https.orderCheckout({}, orderCheckoutBack)
			}

			function orderCheckoutBack(data) {

				if (!data) return;
				if (data.status == 1) {
					if (!data.data) return;
					that.closeAddRecep();
					data = data.data;
					that.showSettlement = 1;
					// that.boxHeight = 215;
					if (that.setSellData.is2amount == 1)
						that.tabTotal.netReceiVal = that.tabTotal.amountOrderPrice;
					that.$emit("checkOut", true);

					that.$refs.receCustInfo.initData(data);

					that.$refs.settlement.initData(that.tabTotal, data, that.ucpList);
					that.setDjTitle();
				}
			}
		},

		/****结帐完成****/
		finishOrderBack(data) {
			if (data && data.isLocalPrint) {
				this.print(data.odid);
			}
			this.$emit("setGdCustomIdNull");
			this.clearData();
			this.showSettlement = -1;
			// this.boxHeight = 170;
			this.showInfo = false;
			this.type = 0;
			this.oldType = 0;
			this.showHideRigthWin();
			this.$emit("checkOut", false);
			this.setDjTitle();
			this.$refs.receCustInfo.initData();
			if (data) {
				if (data.isOnlinePay) {
					//线上二维码支付
					data.objtype = staticConst.PAY_OBJ_01;
					this.$refs.payQrcode.creatQrcode(data);
				}
			}
		},

		/***获取企业打印模板尺寸***/
		getPrintSize(cpid) {
			printSize = printCtrl.printSize;
			// alert(printSize);
			if (printSize == 0) //==0重新请求
			{
				printCtrl.getPrintSize(cpid, back);
			}
			function back(data) {
				printSize = data;
			}
		},

		/****本地打印****/
		print(orderId) {
			if (orderId) {
				let data = {};
				data.cpid = this.cpid;
				data.orderId = orderId;
				data.type = staticConst.ORDER_XS;
				data.type_od = this.orderType;
				if (printSize == staticConst.PRINT_SIZE_241) //241模板
				{
					data.url = config.PRINT_URL_1;
				}
				else if (printSize == staticConst.PRINT_SIZE_80)//80模板
				{
					data.url = config.PRINT_URL_2;
				}
				printCtrl.print(data);
				this.printCount(orderId);
			}
		},

		/***打印次数累计***/
		printCount(orderId) {
			let that = this;
			let param = {};
			param.cpid = this.cpid;
			param.type = staticConst.ORDER_XS;
			param.odtype = this.orderType;
			param.odid = orderId;
			https.printCount(param);
		},

		/****改变发货方式***/
		changeSendGoodsType(data) {
			this.$refs.settlement.changeSendGoodsType(data);
		},

		/***输入收货人****/
		consignVal(e) {
			this.$refs.settlement.consignVal(e);
		},

		/****输入电话号码***/
		inputPhone(e) {
			this.$refs.settlement.inputPhone(e);
		},

		/***选择地区****/
		areaChange(province, city, area) {
			this.$refs.settlement.areaChange(province, city, area);
		},

		/****输入地址***/
		inputAddress(e) {
			this.$refs.settlement.inputAddress(e);
		},

		/***关闭右侧窗口**/
		showHideRigthWin() {
			cmd.external(cmd.CMD_SHOW_MORE, this.showInfo);
		},

		getBoxHeight() {
			this.emptyHight = uni.getSystemInfoSync().windowHeight - 110;
		},

		addEvent() {
			uni.$on(eventCtrl.CHANGE_SIZE_EVENT, this.getBoxHeight);
		},

		removeEvent() {
			uni.$off(eventCtrl.CHANGE_SIZE_EVENT);
		},
	},
	mounted() {
		this.addEvent();
	},
}
</script>
<style lang="scss">
.receipt-info {
	flex: 1;
	margin-left: 345px;
	height: 100vh;
	background-color: #FFF;

	// border-right: #ECECEC 1px solid;
	.overflow-box {
		overflow-y: auto;

		// height: calc(100vh - 171px);
		button {
			margin: 10px 0;
			background: #007AFF;
			color: #FFF;
			font-size: 20px;
		}
	}

	.overflow-box::-webkit-scrollbar {
		/*滚动条整体样式*/
		width: 4px;
		/*高宽分别对应横竖滚动条的尺寸*/
		height: 0px;
	}

	.overflow-box::-webkit-scrollbar-thumb {
		/*滚动条里面小方块*/
		border-radius: 10px;
		-webkit-box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1);
		background: #ccc; //rgba(0, 0, 0, 0.0);
		scrollbar-arrow-color: red;
	}

	.overflow-box::-webkit-scrollbar-track {
		/*滚动条里面轨道*/
		-webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0);
		border-radius: 0;
		background: rgba(0, 0, 0, 0);
	}

	.bttom-btn-box {
		width: 100%;
		position: fiexd;
		bottom: 0;
	}

	.info-content {
		display: flex;
		// align-items: center;
		// justify-content: flex-start;
	}

	.b-info {
		// padding-right: 310px;
		// margin-right: 310px;
		width: 100%;
		height: 100%;
		border-right: 1px solid #ECECEC;
		background: #fff;

		.empty-p-style {
			// padding-top: 110px;
			// height: 800px ;
		}
	}

	.c-info {
		width: 310px;
		height: 100%;
	}
}
</style>